import java.io.Serializable;
import java.util.ArrayList;


public class Questionnaire implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2301686840948338120L;
	private ArrayList<Question> list;
	private int ownerID;
	private ArrayList<Integer> users;
	
	
	public Questionnaire(int ownerID, ArrayList<Question> list, ArrayList<Integer> users){
		this.list = list;
		this.ownerID = ownerID;
		this.users = users;
	}
	
	public void addQuestion(Question q){
		list.add(q);
	}
	
	public boolean isUser(int id) {
		return users.contains(id);
	}
	
	public Question getQuestion(int id){
		if(id<list.size() && id>=0){
			return list.get(id);
		}
		return null;
	}

	public int size() {
		return list.size();
	}

	public int getOwner() {
		return ownerID;
	}
}
